package com.wd.jetpack.model.data.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.wd.jetpack.model.ArticleBean;

import java.util.List;


@Dao
public interface ArticleDao {
    @Insert
    void insert(ArticleBean data);

    @Update()
    int update(ArticleBean data);

    @Query("select * from " + ArticleBean.tableName)
    List<ArticleBean> findAll();

    @Query("select * from " + ArticleBean.tableName + " limit 1")
    ArticleBean findFirst();

    @Delete
    void deleteAll(List<ArticleBean> data);

    @Delete
    void delete(ArticleBean data);
}
